#include "Cursor.hpp"
#include <iostream>
#define VIEW_LARGEUR 600
#define VIEW_HAUTEUR 450

using namespace std;
using namespace sf;

 Cursor::Cursor()
{
    cDAT read_test;
    char* buffer;
    read_test.Read("level1.1.dat");

    buffer = read_test.GetFile("Cursor.png");

    if (!image.loadFromMemory(buffer, read_test.GetFileSize("Cursor.png")))
        exit(-1);
    image.createMaskFromColor(Color(255,255,255),0);
    texture.loadFromImage(image);
    texture.setSmooth(false);

    sprite.setTexture(texture);
    sprite.setPosition(VIEW_LARGEUR/2,VIEW_HAUTEUR/2);
    x=VIEW_LARGEUR/2;
    y=VIEW_HAUTEUR/2;
}

void Cursor::move(int x, int y)
{
    this->x=x;
    this->y=y;
    sprite.setPosition(x,y);
}


Sprite Cursor::getSprite(){return sprite;}
int Cursor::getY(){return y;}
int Cursor::getX(){return x;}

